Only use github.token on github.com#443
Merged
brcrista merged 7 commits intoactions:mainfrom Aug 30, 2022
Merged
Conversation
This expression evaluates to `''` if called from GHES hosted elsewhere You can still provide your token on both github.com and GHES
Contributor
|
Thanks for the suggestion! Let me try testing this against a GHES instance with #437 re-enabled. |
Contributor
|
Tested on a GHES instance (3.6.0) with this workflow: name: CI
on: [workflow_dispatch]
jobs:
sample_build:
runs-on: [ self-hosted ]
steps:
- name: "rate limit"
run: |
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $TOKEN" \
https://api-github-com-gh.computerqwq.top/rate_limit
env:
TOKEN: ${{ secrets.GH_DOTCOM_TOKEN }}
- name: Clear the tool cache
run: rm -rf /Users/runner/hostedtoolcache/Python/
- name: Set up Python
uses: brcrista/setup-python@patch-1
with:
token: ${{ secrets.GH_DOTCOM_TOKEN }}
python-version: 3.9.12
- name: "rate limit"
run: |
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $TOKEN" \
https://api-github-com-gh.computerqwq.top/rate_limit
env:
TOKEN: ${{ secrets.GH_DOTCOM_TOKEN }}Confirmed that:
|
Contributor
|
Also regression-tested the default case on github.com and made sure the download still works. |
IvanZosimov
approved these changes
Aug 8, 2022
marko-zivic-93
approved these changes
Aug 8, 2022
marko-zivic-93
approved these changes
Aug 11, 2022
vsafonkin
approved these changes
Aug 11, 2022
brcrista
approved these changes
Aug 30, 2022
Contributor
brcrista
left a comment
There was a problem hiding this comment.
CI is passing now; must have been an issue with one of the hosted images.
Thanks @ChristopherHX for your contribution!
This was referenced Sep 27, 2022
5 tasks
2 tasks
2 tasks
tdfacer
pushed a commit
to ifit/setup-python
that referenced
this pull request
Oct 7, 2025
* Only use github.token on github.com This expression evaluates to `''` if called from GHES hosted elsewhere You can still provide your token on both github.com and GHES * Enshure blank result of expression and not false * Revert "Revert "Pass the `token` input through on GHES (actions#427)" (actions#437)" This reverts commit f05e25d. * fix typo * Add back the doc on the tool cache for self-hosted Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This expression
${{ github.server_url == 'https://github.com' && github.token || '' }}evaluates to''if called from GHES hosted elsewhereYou can still provide your token on both github.com and GHES
See docu https://docs.github.com/en/actions/learn-github-actions/contexts.
Related issue:
Needs PullRequest: #427
#229, without the need for a new input or breaking using the token input on GHES.
Check list: